package IC.AST.nodes;

import IC.AST.*;

/**
 * a unary expression
 */
public class UnaryExpr extends Expression {
	private Operator op;	// the operator
	private Expression operand;	// the operand

	/**
	 * @param opCode the operator
	 * @param operand the operand
	 * @param line the node line number
	 * @param column the node column number
	 */
	public UnaryExpr(Operator op, Expression operand, int line, int column) {
		super(line,column);
		this.op = op;
		this.operand = operand;
	}

	/**
	 * @return the operator
	 */
	public Operator getOp() {
		return this.op;
	}

	/**
	 * @return the operand
	 */
	public Expression getOperand() {
		return this.operand;
	}

	public Object accept(Visitor v) {
		return v.visit(this);
	}
}
